package com.ktjiaoyu.demo2;

/**
 * @ClassName : Printer
 * @Description :
 * @Author : Lzz
 * @Date: 2023/9/25 10:27:49
 */
public class Printer {

    private Ink ink = null;     //墨盒

    private Paper paper = null; //纸

    /**
     * 打印内容
     * @param message
     */
    public void print(String message){
        System.out.println("使用"+ink.getColor(255, 200, 0)+"颜色打印：\n");
        for (int i = 0;i<message.length();i++){
            paper.putInChar(message.charAt(i));
        }
        System.out.println(paper.getContext());
    }

    public void setInk(Ink ink) {
        this.ink = ink;
    }

    public void setPaper(Paper paper) {
        this.paper = paper;
    }
}
